<!DOCTYPE html>
<html>
<head>
	<title>芭蕉花管理平台登录</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="SHORTCUT ICON" href="/img/favicon.ico">
	<script type="text/javascript" src="/mobile/js/jquery.min.js"></script>
	<script type="text/javascript" src="/mobile/js/jquery.easing.js"></script>
	<script type="text/javascript" src="/mobile/js/bjhcom.js"></script>
	<style type="text/css">
		#wrapper {width: 100%;}
	</style>
</head>
<body>
	<div id="wrapper"></div>
</body>

<script type="text/javascript">

	let load = true;
	if (top != self) {
		load = false;
		parent.location.href = '/login.html';
	} else {
		var pathname = window.location.pathname;
		if (pathname != "/login.html") {
			load = false;
			location.href = '/';
		}
	}

	if (load) {
		// 判断手机浏览
		if (isMobile()) {
			var url = "/mobile/login.html";
			var params = {};
			var wrapper = "wrapper";
			getLoginHtml(url, params, wrapper, false, true);
		} else {
			var url = "/pc/login.html";
			var params = {};
			var wrapper = "wrapper";
			getLoginHtml(url, params, wrapper);
		}
	}

	function getLoginHtml(url, params, wrapper, showLoading, fadIn) {
		if (wrapper == undefined || wrapper == null || wrapper == "") {
			wrapper = "wrapper";
		}
		if (showLoading && !$(".loading").hasClass("loading")) {
			var loadingBackDrop = createLoadingBackDrop();
			$("body").append(loadingBackDrop);
		}
		var $wrapper = $("#" + wrapper);
		if (fadIn) {
			$wrapper.animate({
				"opacity": 0
			}, 0, 'easeOutQuad');
		}
		$.ajax({
			url: url,
			type: "GET",
			timeout: 10000,
			data: params,
			success: function(data) {
				if (data.indexOf("<") == 0) {;
					$wrapper.html(data);
					setTimeout(function() {
						if ($(".loading").hasClass("loading")) {
							$(".loading").remove();
						}
						var wait = setInterval(function(){
							if(!$wrapper.is(":animated")){
								clearInterval(wait)
								var height = $(".container-body").height();
								$(".sidebar-collapse").css("height", height);
								if (fadIn) {
									$wrapper.animate({
										"opacity": 1
									}, 300, 'easeOutQuad');
								}
							}
						}, 100);
					}, 500);
				}
			},
			error: function() {
				if ($(".loading").hasClass("loading")) {
					$(".loading").remove();
				}
			}
		});
	}
</script>
</html>